home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1985 January
/
1985-01.d64
/
disk merge
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
66 lines
1 print"[147]":sys65517
2 ifpeek(781)=40thenmt$="":goto100
3 mt$=""
100 goto390
110 get#fi,by$:ifby$<>""thenprint#3,by$;:goto110
120 print#3,nu$;:return
130 get#fi,by$:ifby$=""thenby=0:return
140 by=asc(by$):return
150 dv=wd/256:hi=int(dv):lo=wd-hi*256:print#3,chr$(lo);chr$(hi);:return
160 gosub130:lo=by:gosub130:li(fi)=by*256+lo
170 gosub130:lo=by:gosub130:ln(fi)=by*256+lo
180 ifli(fi)>0thenprinttab((fi-1)*9);ln(fi);"[145]"
190 ca(fi)=ca(fi)+ls(fi):ls(fi)=li(fi)-ca(fi):return
200 li(3)=li(3)+ls(fi):wd=li(3):gosub150:wd=ln(fi):goto150
210 gosub200:gosub110:goto160
220 ifli(1)=0andli(2)=0thenreturn
230 ifli(2)=0thenfi=1:gosub210:goto220
240 ifli(1)=0thenfi=2:gosub210:goto220
250 ifln(1)<ln(2)thenfi=1:gosub210:goto220
260 ifln(1)>ln(2)thenfi=2:gosub210:goto220
270 fi=1:gosub210:fi=2:gosub280:goto220
280 get#fi,by$:ifby$<>""then280
290 goto160
300 gosub130:lo=by:gosub130:ca(fi)=by*256+lo:return
310 wd=ca(3):goto150
320 print prompt$;"[160][160][160][160][160][157][157][157][157][157]";
330 input fi$:fc$=left$(fi$,1)
340 null=fc$="[160]":quit=fc$="*":return
350 open fi,8,fi+2,"0:"+fi$
360 input#15,en,em$,et,es
370 err=en>19:if err then print""en;em$:close fi
375 fori=1to2500:next:return
390 dim ca(3),li(3),ln(2),ls(2)
400 nu$=chr$(0)
410 print:printmt$" disk merge "
420 open 15,8,15
430 fi=1:prompt$="primary file"
440 gosub 320:if null then 440
450 if quit then 700
460 gosub 350:if err then 440
470 fi=2:prompt$="secondary file"
480 gosub 320:secnull=null
490 if secnull then print "*relocate only*":goto530
500 if quit then 700
510 af$=fi$
520 gosub 350:if err then 480
530 fi=3:prompt$=" merged file"
540 gosub 320:if null then 540
550 if quit then 700
560 fi$=fi$+",p,w":gosub 350:if err=0 then 620
570 if en<>70 then 540
580 print "[145] [145]"
590 bf$=fi$:close 2:gosub 350:e2=err
600 fi=2:fi$=af$:gosub350:fi=3:fi$=bf$
610 if e2 then 530
620 input" base address 1025[157][157][157][157][157][157]";base$
630 if left$(base$,1)="*" then 700
640 ca(3)=val(base$):li(3)=ca(3)
650 fi=1:gosub 300:gosub 160
660 if not secnull then fi=2:gosub 300:gosub 160
670 gosub 310
680 gosub 220
690 print#3,nu$;nu$;
700 close 3:close 2:close 1:close 15
710 end